import {createApp,h} from 'vue';
import {createRouter,createWebHashHistory} from 'vue-router';
import App from './App.vue';
import HomeIndex from './views/HomeIndex.vue';

// 路由对象
const router = createRouter({
  // mode:hash
  history:createWebHashHistory(),
  routes:[
    {
      path:'/home/index',
      component:HomeIndex
    },
    {
      path:'/shop/index/:id',
      component:()=>import('./views/ShopIndex.vue')
    },
    {
      path:'/cart/index',
      component:()=>import('./views/CartIndex.vue')
    },
    {
      // /user/abc
      // path:'/:match(.*)',
      path:"/:match(use.+)",
      component:()=>import('./views/NotFound.vue')
    },
  ]
})

const app = createApp(App);
app.use(router)

app.mount('#app');